package com.dgut.common.mapper;

import com.dgut.common.entity.Remark;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.Date;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author it00zyq
 * @since 2021-04-04
 */
@Repository
public interface RemarkMapper extends BaseMapper<Remark> {

    /**
     * 查询用户某一天的备注
     * @param date 日期
     * @param userId 用户ID
     * @return 备注信息
     */
    @Select("select * from remark where user_id = #{userId} and date(remark_date) = date(#{date})")
    Remark selectByDate(@Param("date") Date date, @Param("userId") Integer userId);

}
